﻿<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
<%@ taglib uri="/WEB-INF/qautil.tld" prefix="qautil"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<script type="text/javascript" src="<%=request.getContextPath()%>/qa/js/Calendar.js"></script>
<script type="text/javascript">
	function beforeSubmit(pform, type){
		pform.action.value = type;
	}
	function validate(pform){
		if(pform.action.value == "monthreport" || pform.action.value == "excel"){
			if(pform.userIds.value == ""){
				alert("用户登录名不能为空");
				pform.userIds.focus();
				return false;
			}
			if(pform.fromDate.value == ""){
				alert("开始日期不能为空");
				pform.fromDate.focus();
				return false;
			}
			if(pform.toDate.value == ""){
				alert("结束日期不能为空");
				pform.toDate.focus();
				return false;
			}
			return true;
		}
		return true;
	}
</script>
<html:form method="post" action="/money" onsubmit="return validate(this);">
	用户登录名：<html:text property="userIds" size="45" value='<%=request.getParameter("userIds")==null?com.mr.qa.GlobalConfigs.MONEY_AWARD_LOGIN_ID:request.getParameter("userIds")%>'/>
	<input type="hidden" name="action" value="monthreport" />
	日期 从：
	<html:text property="fromDate" size="10" onchange="javascript:gChangeDate(this,0);" onblur="javascript:gChangeDate(this,0);" onclick='showCalendar(fromDate,0)'/>
	到：
	<html:text property="toDate" size="10" onchange="javascript:gChangeDate(this,0);" onblur="javascript:gChangeDate(this,0);" onclick='showCalendar(toDate,0)'/>
	<input type="submit" value="查询" onclick="beforeSubmit(this.form, 'monthreport')"/>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="image" src="qa/images/Excel-16.gif" onclick="beforeSubmit(this.form, 'excel')">
	<br/><br/>
	<html:link page="/money.mrqa?action=viewawardlist">查看所有奖励用户</html:link>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	每页显示<html:text property="pageSize" size="2" value='<%=com.mr.qa.GlobalConfigs.SIZE_AWARD_LIST+""%>' />条奖励记录
	<input type="submit" value="设置" onclick="beforeSubmit(this.form, 'changePageSize')"/>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<html:link page="/money.mrqa?action=preaward">奖励用户</html:link>
</html:form>
<c:if test="${reportResult != null}">
<display:table name="reportResult" class="qlist" id="moneyReport" cellpadding="0" cellspacing="0">
    <display:column title="用户名">
    	<html:link page="/user.mrqa?action=viewuserbyother" paramId="id" paramName="moneyReport" paramProperty="userId">
    		<c:out value="${moneyReport.loginName}"/>
    	</html:link>
    </display:column>
    <display:column title="发帖数">
    	<c:out value="${moneyReport.questionCount}"/>
    </display:column>
    <display:column title="回复数">
    	<c:out value="${moneyReport.answerCount}"/>
    </display:column>
    <display:column title="上传数">
    	<c:out value="${moneyReport.sharedFileCount}"/>
    </display:column>
    <display:column title="推荐数">
    	<c:out value="${moneyReport.recommendCount}"/>
    </display:column>
    <display:column title="经验值">
    	<c:out value="${moneyReport.totalScore}"/>
    </display:column>
</display:table>
</c:if>
<c:if test="${awardResult != null}">
<display:table name="awardResult" class="qlist" id="userMoneySpendHistory" cellpadding="0" cellspacing="0">
    <display:column title="用户名">
    	<html:link page="/user.mrqa?action=viewuserbyother" paramId="id" paramName="userMoneySpendHistory" paramProperty="user.id">
    		<c:out value="${userMoneySpendHistory.user.loginName}"/>
    	</html:link>
    </display:column>
    <display:column title="奖励分数">
    	<c:out value="${userMoneySpendHistory.money}"/>
    </display:column>
    <display:column title="奖励时间">
    	<fmt:formatDate value="${userMoneySpendHistory.date}" var="postDatexx" type="both" pattern="yyyy-MM-dd HH:mm:ss"/><c:out value="${postDatexx}"/>
    </display:column>
</display:table>
<qautil:page action="/money.mrqa"/>
</c:if>

